package java44th.group.controller.wx.brand;

import java44th.group.bean.admin.vo.BaseRespVo;
import java44th.group.bean.common.BasePageInfo;
import java44th.group.bean.common.CommonData;
import java44th.group.bean.po.MarketBrand;
import java44th.group.bean.wx.vo.brand.ListVo;
import java44th.group.service.wx.brand.WxBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ProjectName project-second
 * @Descriptiom TODO
 * @Aurhor: 蔡文强
 * @Since: 2022/10/14 23:57
 */
@RestController
@RequestMapping("wx/brand")
public class WxBrandController {

    @Autowired
    WxBrandService wxBrandService;

    @RequestMapping(value = "list",method = RequestMethod.GET)
    public BaseRespVo list(BasePageInfo basePageInfo){

       CommonData<ListVo> listVoCommonData = wxBrandService.queryBrandList(basePageInfo);

        return BaseRespVo.ok(listVoCommonData);
    }

    @RequestMapping(value = "detail",method = RequestMethod.GET)
    public BaseRespVo detail(Integer id){

        MarketBrand marketBrand = wxBrandService.queryBrandInfoById(id);

        return BaseRespVo.ok(marketBrand);
    }

}
